package cn.itsource.configuration;

import cn.itsource.config.TxCosConfig;
import cn.itsource.service.EmailTemplate;
import cn.itsource.service.TXCosTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;

/**
 * @program fccar_240420
 * @Description
 * @Date 2024/09/04 11:24
 * @Version 1.0
 */
@Configuration
@EnableConfigurationProperties(TxCosConfig.class)
public class TxCosConfiguration {
    @Bean
    public TXCosTemplate getTXCosTemplate(TxCosConfig txCosConfig){
        return new TXCosTemplate(txCosConfig);
    }

    @Bean
    public EmailTemplate getEmailTemplate(JavaMailSender javaMailSender){
        return new EmailTemplate(javaMailSender);
    }
}
